package com.hgw.Demo09_StrategyPattern.Exercises24_7_5;

/**
 * Data time:2021/12/20 21:50
 * StudentID:2019112118
 * Author:hgw
 * Description: 文件类，充当环境类
 */
public class File {
    private String fileName;
    private Encryption encryption;

    public File(String fileName) {
        this.fileName = fileName;
    }

    public void setEncryption(Encryption encryption) {
        this.encryption = encryption;
    }

    public void encrypt() {
        System.out.println("--------加密--------");
        encryption.encrypt(fileName);
        System.out.println("加密成功");
    }
}
